#include "pushbtnview.h"

PushBtnView::PushBtnView(QWidget *parent)
    : QWidget{parent}
{
    setUI();
}

void PushBtnView::setUI()
{
    vLayout = new QVBoxLayout();
    vLayout->setContentsMargins(0,0,0,0);
    vLayout->setSpacing(0);
    setLayout(vLayout);

    QList <QString> list;
    list<<"CM"<<"AM"<<"DATB"<<"iATP"<<"iATO"<<""<<"确认"<<"菜单"<<"设置";
    for (int i = 0; i < list.length(); i++){
        pushButton[i] = new QPushButton();
        pushButton[i]->setText(list[i]);
        pushButton[i]->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        pushButton[i]->setObjectName("modeBtn");
        if(i == 5) pushButton[i]->setObjectName("modeNoneBtn");
        if(i == list.length()-1) pushButton[i]->setObjectName("modeBottomBtn");
        vLayout->addWidget(pushButton[i],64);
    }
}
